@extends('common.base-master')

@section('html-head')
    <link rel="stylesheet" type="text/css" href="{{url('css/bootstrap.min.css')}}">
    <link rel="stylesheet" type="text/css" href="{{url('css/institutions.css')}}">
@endsection

@section('html-body')
    <main>
        <div class="mainWrapp">
            @include('common.company-section')
            <div class="contain">
                <section class="nav_list">
                    <div>
                        <div class="list">
                            <span class="proList"><button class="clear"></button></span>
                        <div class="search_info">
                            <input type="text" placeholder="请输入您要搜索的信息" />
                        </div>
                        <div class="row">
                            <nav>
                                <ul>
                                    <li><a href="#">轮段</a></li>
                                    <li><a href="#">领域</a></li>
                                    <li><a href="#">地区</a></li>
                                </ul>
                            </nav>

                        </div>
                        <div class="filter-row">
                            <ul class="tab filter-1 hide" data-index="1">
                                @foreach($phases as $phase)
                                <li><a href="#" keyword="{{$phase->id}}">{{$phase->phase}}</a></li>
                                @endforeach
                            </ul>
                            <ul class="tab filter-2 hide" data-index="2">
                                @foreach($fields as $field)
                                <li><a href="#" keyword="{{$field->id}}">{{$field->field}}</a></li>
                                @endforeach
                            </ul>
                            <ul class="tab filter-3 hide" data-index="3">
                                <li><a name="district" href="javascript:void(0)" dist_name="">全部</a></li>
                                @foreach(\App\District::all() as $district)
                                    <li><a name="district" keyword="{{$district->dist_name}}" href="javascript:void(0)" dist_name="{{urlencode
                                    ($district->dist_name)}}">{{$district->dist_name}}</a></li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                </section>
                <section>
                    <h3>项目简介</h3>
                    <p class="count"><em>{{\App\InvestOrg::whereStatus(1)->count()}}</em> \ 筛选结果</p>
                    <div>
                        <ul class="nav_tab">
                            <li class="desc">投资机构简介</li>
                            <li class="stage">投资阶段</li>
                            <li class="type">机构成员</li>
                            <li class="address">投资案例</li>
                            <li class="member">操作</li>
                        </ul>
                        <div class="content">
                            <ul>
                                @if($investOrg)
                                @foreach($investOrg as $org)
                                <li>
                                    <dl>
                                        <dt>
                                            <a href="{{route('Home.InvestOrg.getInvestOrgDetails' , ['id'=>$org->id])}}"><img src="{{route('Api.OrgLogo.Show' , ['id'=>$org->id])}}"
                                                        /></a>
                                        </dt>
                                        <dd class="commpany">
                                            <p><a href="{{route('Home.InvestOrg.getInvestOrgDetails' , ['id'=>$org->id])}}"><strong>{{$org->invest_name}}</strong></a></p>
                                            <p>{{$org->invest_desc}}</p>
                                        </dd>
                                        <dd class="list">
                                            <div class="list_content">
                                                <p class="stage"><em class="reveal">融资阶段</em>
                                                        @if($phases = $org->getPhasesByOrgId($org->id))
                                                            @foreach($phases as $phase)
                                                            <em class="floatR">{{$phase}}</em>
                                                            @endforeach
                                                        @endif
                                                    </p>
                                                <p class="type"><em class="reveal">机构成员</em>

                                                    @if($investors = $org->getOrgMemberbyOrgId($org->id))
                                                        @foreach($investors as $investor)
                                                            <em class="floatR">{{$investor['realname']}}</em>
                                                        @endforeach
                                                    @endif
                                                </p>
                                                <p class="address"><em class="reveal">投资案例</em>
                                                    @if($projects = $org->getProjectNameByOrgId($org->id))
                                                        @foreach($projects as $project)
                                                        <em class="floatR">{{$project}}</em>
                                                        @endforeach
                                                    @endif
                                                </p>
                                                <p class="member"><button class="reveal" data="{{$org->id}}">提交项目</button></p>
                                            </div>
                                        </dd>
                                    </dl>
                                </li>
                                @endforeach
                                @endif
                                </ul>
                        </div>
                    </div>
                    <p class="more_bar">查看更多</p>
                </section>
            </div>
        </div>
        <div class="p_pos createProject">
            <!--单选1-->
            <div class="new">
                <p>您还没有项目，现在去创建吧！</p><p>
                    <a href="{{route('Home.Project.showCreateProject')}}"><button>创建项目</button></a>
                    <em class="close"></em>
                </p>
            </div>
            <!--单选2-->
            <div class="p_pos_s" style="display: none;">
                <p>申请融资</p>
                <select>
                    @if(Auth::user())
                    @if($userId = Auth::user()->id)
                        @if($projects = \App\Project::whereUserId($userId)->get())
                            @foreach($projects as $project)
                                <option value="{{$project->id}}">{{$project->project_name}}</option>
                            @endforeach
                        @endif
                    @endif
                    @endif
                </select><br>
                <button>提交项目</button>
                <em class="close"></em>
            </div>
        </div>
        <div class="mirror">123</div>
    </main>
    <script type="text/javascript">
        var getProjectByUserId              = "{{route('Api.Project.getProjectByUserId')}}";
        var CommitProjectToInvestOrg        = "{{route('Api.Project.CommitProjectToInvestOrg')}}";
        var getMore                         = "{{route('Api.Invest.getInvestOrgMore')}}";
        var showPhoto                       = "{{route('Api.OrgLogo.Show' ,['id'=>0])}}";
        var getDetailById                   = "{{route('Home.InvestOrg.getInvestOrgDetails',['id'=>0])}}";
        var getSearchMessageByTag           = "{{route('Api.InvestOrg.getSearchMessage')}}";
    </script>
    <script src="{{url('js/invest_org_more.js')}}"></script>
    <script src="{{url('js/institutions.js')}}"></script>

@endsection